from redis import Redis, ConnectionPool


def redis_conn():
    pool = ConnectionPool(host='127.0.0.1', port=16379, password='', decode_responses=True)  # 建立redis连接池
    redis_cli = Redis(connection_pool=pool)
    return redis_cli


if __name__ == '__main__':
    redis_conn()
